-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use declarative helper methods in all smart answers #4539
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kevindew
force-pushed
the
explanatory-helpers
branch
3 times, most recently
from
May 29, 2020 09:28
95a797b
to
0215636
Compare
kevindew
force-pushed
the
explanatory-helpers
branch
from
June 4, 2020 09:49
0215636
to
28fb339
Compare
kevindew
force-pushed
the
change-all-the-smart-answers
branch
2 times, most recently
from
June 22, 2020 09:17
7973d62
to
b10ee1a
Compare
theseanything
force-pushed
the
change-all-the-smart-answers
branch
from
June 30, 2020 12:14
b10ee1a
to
a0518a5
Compare
These files contain mixed media so a .govspeak.erb filename is a bit misleading. A plain .erb extension is more representative of how these files contain a mixture of plain text, govspeak and (potentially) HTML. Command used: ``` find . -name '*.govspeak.erb' -exec sh -c 'mv "$1" "${1%.govspeak.erb}.erb"' _ {} \; ``` There are some files in here that contain only govspeak, these tend to be partials (for example lib/smart_answer_flows/marriage-abroad/outcomes/_contact_local_authorities.erb), I don't think it's worth specifying these as .govspeak.erb currently as I don't think that offers advantages to outweigh the challenges that a mixed bag of extensions may create. Maybe this is something useful if we started adding a number of .html.erb files.
This is no longer necessary, these will load fine with just the basename. This makes them more consistent with common Rails partial loading paradigms.
This replaces the lone use of render_content_for to allow HTML rendering with a html_for method.
This uses govspeak_for instead.
This sets all of these scenarios of setting text content to use the text_for helper method.
theseanything
force-pushed
the
change-all-the-smart-answers
branch
from
June 30, 2020 12:28
a0518a5
to
3973cd7
Compare
theseanything
approved these changes
Jun 30, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @kevindew - for deploying these changes, we should freeze CD and rollout manually so we can see if there's any issue that come up in staging.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is built on #4527 and makes changes to all the smart answers.
It removes
.govspeak
from file extensions, it removes file extensions from partial calls and it renames therender_content_for
methods to eithertext_for
orgovspeak_for
methods.This includes every smart answer except for the new one, employee risk assessment, since 1) I did this before that existed and 2) there are open PRs for this and it feels like it could change again since it's so new.
The easiest approach to review this is doing it commit by commit. Each commit is focused on one granular change so it should be pretty easy to scroll through a lot of changes looking for any signs of an anomaly.
Here's a few links to popular smart answer pages on preview (pulled out from athena) to make checking it's working easier: